package model

import "community_end/utils/errmsg"

type PostTag struct {
	PostID int
	TagID  int
}

func (PostTag) TableName() string {
	return "post_tag"
}

func DeleteTagByPostID(id int) int {
	err := db.Where("post_id", id).Delete(&PostTag{}).Error
	if err != nil {
		return errmsg.TAG_DELETE_FAILED
	}
	return errmsg.SUCCESS
}
